import { View, TextInput, TouchableOpacity } from 'react-native';
import { Ionicons } from '@expo/vector-icons';

interface SearchBarProps {
  onSearch?: (text: string) => void;
  placeholder?: string;
}

export default function SearchBar({ onSearch, placeholder = '搜索商品' }: SearchBarProps) {
  return (
    <View className="px-4 py-2 bg-white/80 backdrop-blur-md">
      <View className="flex-row items-center bg-gray-100 rounded-full px-4 py-1">
        <Ionicons name="search" size={20} color="#666" />
        <TextInput
          className="flex-1 ml-2 text-base text-gray-700"
          placeholder={placeholder}
          placeholderTextColor="#999"
          onChangeText={onSearch}
        />
      </View>
    </View>
  );
} 